<?php
/********************************************************
 * 
 * Copyright (c) 2007 - 2008
 * 
 * 要查看完整的版权信息和许可信息,请查看源代码中附带的 COPYRIGHT 文件,
 * 
 * 此文件的作用:工资表
 * 
 * @copyright Copyright (c) 2007 - 2008
 * @author 刘昌功 lcg635@126.com
 * 
 ********************************************************/

defined('APP_DIR') or die('404 Not Found');

FLEA::loadClass('Common_Table');

class Table_Wage extends Common_Table {
    var $tableName = 'wage';
    var $primaryKey = 'wage_id';
	
    /**
     * 返回工资表的表单
     *
     * @param 工资内容 $data
     */
    function form($data) {
    	$ui = FLEA::initWebControls();
    	$form = array(
    		'num' => $ui->control('Textbox', 'num',
				array(
					'value' => $data['num'],
					'maxlength' => 18
				),
				true
			),
			'station' => $ui->control('Textbox', 'station',
				array(
					'value' => $data['station']
				),
				true
			),
			'bankCardNum' => $ui->control('Textbox', 'bankCardNum',
				array(
					'value' => $data['bankCardNum']
				),
				true
			),
			'startDate' => $ui->control('Textbox', 'startDate',
				array(
					'value' => $data['startDate']
				),
				true
			),
			'finishDate' => $ui->control('Textbox', 'finishDate',
				array(
					'value' => $data['finishDate']
				),
				true
			),
			'sort' => $ui->control('DropdownList', 'sort',
				array(
					'items' => array(
						'日期' => 'created',
						'学号' => 'num',
						'岗位' => 'station'
					),
					'selected' => $data['sort']
				),
				true
			),
			'by' => $ui->control('DropdownList', 'by',
				array(
					'items' => array(
						'升序' => 'asc',
						'降序' => 'desc'
					),
					'selected' => $data['by']
				),
				true
			)
    	);
    	return $form;
    }
}
